home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
NOVA - For the NeXT Workstation
/
NOVA - For the NeXT Workstation.iso
/
Documents
/
NeXTAnswers
/
sysadmin.344
< prev
next >
Wrap
Text File
|
1992-02-06
|
2KB
|
72 lines
{\rtf0\ansi{\fonttbl\f3\fnil Times-Roman;\f0\fmodern Courier;}
\paperw9080
\paperh5440
\margl120
\margr120
\pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\f3\b0\i0\ul0\fs24 NetInfo niutil mounts slashes\
\
Q: How do I access the individual 'mounts' database entries using niutil?\
Because of the slashes in the property values, niutil doesn't seem to\
understand....\
\
A: Indeed, if you try something straightforward like\
\
\f0 niutil -read . /mounts//dev/sd0a\
\f3 \
you'll get an error message such as\
\
\f0 niutil: can't open .:/mounts//dev/rsd0a\
\f3 \
because
\f0 niutil
\f3 is using / to separate properties. So, let's say we\
have the following:\
\
\f0 % niutil -list . /mounts\
133 /dev/sd0a \
134 /dev/sd0b \
137 /dev/sd1a \
\f3 \
and we want to do an
\f0 niutil -read
\f3 on the /dev/sd0a entry. We have to\
find some way to escape those /s in the property value (“/dev/sd0a”) or\
we're sunk. The simple ways don't work:\
\
\f0 % niutil -read . /mounts\\/dev\\/rsd0a\
niutil: can't open .:/mounts/dev/rsd0a\
\
% niutil -read . /mounts/'/dev/rsd0a'\
niutil: can't open .:/mounts//dev/rsd0a\
\f3 \
Turns out it's necessary to use a DOUBLE \\ to get the proper escaping:\
\
\f0 % niutil -read . /mounts/\\\\/dev\\\\/sd0a\
name: /dev/sd0a \
dir: / \
type: 4.3 \
opts: rw noquota noauto \
freq: 1 \
passno: 1 \
\f3 \
Why? Because if one types simply '\\/' the shell will gobble the escape character\
(the \\), and transform this into '/'. If one types TWO \\s, then the shell will turn\
them into one, and there will be one in the string passed to niutil as its argument.\
\
QA344\
\
Valid for 1.0 \
Valid for 2.0\
\